
<script>
  import $ from 'dfish-widget'
  import Dialog from './Dialog.vue'
  import text from '../widget.text.js'

  export default {
    mixins: [Dialog],
    data() {
      return {
        name: 'Alert',
        remark: '警告框',
        extends: [text],
        deprecate: 'commands,context',
        examples: [{
          remark: '点击"测试"按钮，在屏幕右下角弹出提示框',
          type: 'html',
					view: true,
          code: `
            <template>
              <w-button @click="click" text="测试"></w-button>
            </template>
            <${'script'}>
              import $ from 'dfish-widget'
              export default {
                methods: {
                  click(e) {
                    $(e).pop('w-alert', {
                      text: '提示内容',
                      position: 'br',
                      timeout: 3000,
                    })
                  }
                }
              }
            </${'script'}>
          `,
					comp: {
						methods: {
							click(e) {
							  $(e).pop('w-alert', {
							    text: '提示内容',
							    position: 'br',
							    timeout: 3000,
							  })
							}
						}
					}
        }]
      }
    },
    created() {
      this.merge([
        {
          name: 'escape',
          remark: '设置为false，文本参数text将以html格式显示。',
          type: 'Boolean',
          default: 'true'
        }, {
          name: 'yes',
          remark: '点击确定或关闭时触发',
          type: 'Function',
        }, {
          name: 'icon',
          remark: '图标',
          type: 'String',
        }, {
          name: 'show-button',
          remark: '是否显示确定按钮',
          type: 'Boolean',
          default: 'true'
        }], 'attrs')
    }
  }
</script>
